package enums;

import lombok.extern.slf4j.Slf4j;

enum Shrubbery { GROUND, CRAWLING, HANGING }

@Slf4j
public class EnumClass {

    public static void main(String[] args) {
        for(Shrubbery s : Shrubbery.values()) {
            log.error(
                s + " ordinal: " + s.ordinal());
            log.error(
                s.compareTo(Shrubbery.CRAWLING) + " ");
            log.error(
                s.equals(Shrubbery.CRAWLING) + " ");
            log.error(String.valueOf(s == Shrubbery.CRAWLING));
            log.error(String.valueOf(s.getDeclaringClass()));
            log.error(s.name());
            log.error("********************");
        }

        for(String s :
            "HANGING CRAWLING GROUND".split(" ")) {
            Shrubbery shrub =
                Enum.valueOf(Shrubbery.class, s);
           log.error(String.valueOf(shrub));
        }
    }

}
